package com.sgb.kjwl.view.ui.adapter.self.pick;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.user.InvitationOfferEntity;
import com.sgb.kjwl.model.entity.user.UserPickProjectEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class InvitationOfferAdapter extends BaseRecycleAdapter<InvitationOfferEntity> {
    private TextView tvStatus;

    public InvitationOfferAdapter(Context context, List<InvitationOfferEntity> datas) {
        super(context, R.layout.item_invitation_offer, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final InvitationOfferEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        tvStatus = holder.getItem().findViewById(R.id.tv_status);
        if ("0".equals(entity.getStatus())){
            tvStatus.setText("未报价");
        }else {
            tvStatus.setText("已报价");
        }

    }

    private InvitationOfferAdapter.onEditClickListener editClickListener;

    public void setonEditClick(InvitationOfferAdapter.onEditClickListener editClickListener) {
        this.editClickListener = editClickListener;
    }

    public interface onEditClickListener {
        void onDetailedListClick(InvitationOfferEntity entity, int position);
    }
}
